package com.icxx.learn.controller;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.client.RestTemplate;

@RestController
public class ZipkinFirController {

    private static final Logger LOG = LoggerFactory.getLogger(ZipkinFirController.class);

    @Autowired
    private RestTemplate restTemplate;

    @RequestMapping("/callFir")
    public String callFir(){
        LOG.info( "calling trace service-zipkin-fir  ");
        return restTemplate.getForObject("http://localhost:8989/info", String.class);
    }

    @RequestMapping("/info")
    public String info(){
        LOG.info( "calling trace service-zipkin-fir ");
        return "i'm service-zipkin-fir";

    }



}
